package cn.xo68.ide.plugin.common.service;

import cn.xo68.core.PropertiesDocument;
import cn.xo68.ide.plugin.common.domain.CodeGenerateInfo;
import cn.xo68.ide.plugin.common.domain.TableModuleConfig;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.wy2.generator.database.common.DatabaseMetaDataEntity;

public interface CodeGenerateManager {
    static CodeGenerateManager getInstance() {
        return ServiceManager.getService(CodeGenerateManager.class);
    }

    /**
     * 加载代码生成配置信息
     * @param projectVirtualFile
     * @return
     */
    PropertiesDocument loadGenerateConfig(VirtualFile projectVirtualFile);

    /**
     * 加载代码生成信息
     * @param projectVirtualFile
     * @return
     */
    CodeGenerateInfo loadCodeGenerateInfo(VirtualFile projectVirtualFile);

    void saveCodeGenerateInfo(VirtualFile projectVirtualFile, CodeGenerateInfo codeGenerateInfo);

    DatabaseMetaDataEntity loadLocalDatabaseMetaData(VirtualFile projectVirtualFile);

    DatabaseMetaDataEntity loadRemoteDatabaseMetaData(VirtualFile projectVirtualFile);

    DatabaseMetaDataEntity loadDatabaseMetaData(VirtualFile projectVirtualFile, boolean reload);

    TableModuleConfig loadTableModuleConfig(VirtualFile projectVirtualFile);

    void saveTableModuleConfig(VirtualFile projectVirtualFile, TableModuleConfig moduleConfig);
}
